#pragma once

// CWndGSensor

#define ALARM_X		0.05
#define ALARM_Y		0.05
#define ALARM_Z		0.5

#define GSEN_ANGLE			3
#define GSEN_DIRECTION		2

class CWndGSensor : public CWnd
{
	DECLARE_DYNAMIC(CWndGSensor)

private:	
	CRect m_rtCoordi[GSEN_ANGLE];		//z, y, x
	CRect m_rtSenIndi[GSEN_ANGLE][GSEN_DIRECTION];

	BOOL			m_bSensorOn[GSEN_ANGLE][GSEN_DIRECTION];
	DWORD			m_dwSetTime2[GSEN_ANGLE][GSEN_DIRECTION];

	float			m_fSensorX;
	float			m_fSensorY;
	float			m_fSensorZ;

	CPen m_penEdge;
	CBrush m_burshBoard;
	CBitmap m_bmpPanel;
	CDC m_dcBmpPanel;
	CStringArray m_sarrText;

	void LoadText();
	void InitDraw(int cx, int cy);
	void InitDraw_m0(int cx, int cy);
	void InitDraw_m1(int cx, int cy);

public:
	CWndGSensor();
	virtual ~CWndGSensor();

	void SetSensorValue(float fX, float fY, float fZ);
	void UpdateGSensor();
	void UpdateGSensor_m0();
	void UpdateGSensor_m1();

	void RefreshLang();

protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnPaint();
	DECLARE_MESSAGE_MAP()

public:	
	afx_msg void OnSize(UINT nType, int cx, int cy);
};

extern CWndGSensor* g_pWndGSensor;
